function Observer(){
	
   this.Update = function(){
      return true;
   };
}


function Subject(){
   this.observers = new ObserverList();
}

Subject.prototype.Notify = function( context ){
	for( var i = 0; i < this.observers.total(); i++ )
		this.observers.get(i).Update( context );
};

Subject.prototype.AddObserver = function( observer ){
	if( !observer.Update )
		throw 'Wrong parameter';
	this.observers.add( observer );
};

Subject.prototype.RemoveObserver = function( observer ){
	if( !observer.Update )
		throw 'Wrong parameter';
	this.observers.RemoveAt(this.observers.indexOf(observer));
};

function inherits(base, extension){
   for ( var property in base )
   {
      try
      {
         extension[property] = base[property];
      }
      catch( warning ){}
   }
}